package leetcode;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * ClassName: DianXinT1
 * Package: leetcode
 * Description:
 *
 * @Author wjn
 * @Create 2025/9/27 09:45
 * @Version 1.0
 */
public class DianXinT2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        for(int i = 0; i < t; i++){
            int n = scanner.nextInt();
            int k = scanner.nextInt();
            Set<Integer> dSet = new HashSet<>();
            for (int j = 0; j < k; j++) {
                dSet.add(scanner.nextInt());
            }
            String result = findLexSmalLestWord(n, dSet);
            System.out.println(result);
        }
        scanner.close();
    }

    private static String findLexSmalLestWord(int n, Set<Integer> dSet) {
        for (int w1 = 1; w1 <= 26; w1++){
            for (int w2 = 1; w2 <= 26; w2++) {
                int diff1 = Math.abs(w1 - w2);
                if (!dSet.contains(diff1)) {
                    continue;
                }
                int w3 = n - w1 - w2;
                if (w3 < 1 || w3 > 26) {
                    continue;
                }
                int diff2 = Math.abs(w2 - w3);
                if (dSet.contains(diff2)) {
                    char c1 = (char)('a' + w1 - 1);
                    char c2 = (char)('a' + w2 - 1);
                    char c3 = (char)('a' + w3 - 1);
                    return String.valueOf(c1) + c2 + c3;
                }
            }

        }
        return "NO";
    }
}
